const koa = require('koa')
const app = new koa()

const KoaSwagger = require('koa2-swagger-ui')
app.use(KoaSwagger({
  routePrefix: '/swagger',
  swaggerOptions: {
    url: 'swagger.json'
  }
}))
const swagger = require('./util/swagger')
app.use(swagger.routes(), swagger.allowedMethods())

const router = require('./routes/index')
const test = require('./routes/test')

app.use(router.routes(), router.allowedMethods())
app.use(test.routes(), router.allowedMethods())



app.use(async ctx => {
  ctx.body = '哈哈哈'
})

app.listen(3000, () => {
  console.log('Server is running to 3000')
})